package com.itboye.boyeshoping;

import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.RelativeLayout;

import com.itboye.boyeshoping.activity.SearchGoodsActivity;
import com.itboye.boyeshoping.fragment.CheapFragment;
import com.itboye.boyeshoping.fragment.HomeFragment;
import com.itboye.boyeshoping.fragment.MyFragment;
import com.itboye.boyeshoping.fragment.SearchRabateFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/6/26 0026.
 */

public class Prictice {
private HomeFragment homeFragment;
private CheapFragment cheapFragment;
private MyFragment myFragment;
private SearchRabateFragment searchRabateFragment;
private RelativeLayout   backRl ;
private GridView goodsGv;
private Activity context;
private EditText editText;
   public void fun(){

      final List<String> array=new ArrayList();
      array.add("一元购");
        context.startActivity(new Intent(context, SearchGoodsActivity.class));
       editText.addTextChangedListener(new TextWatcher() {
           @Override
           public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
               Boolean [] updateTag;
               String a="afda";
               String[] split = a.split(",");
               for (int j=0;j<split.length;j++){

               }
               updateTag=new Boolean[array.size()];
               updateTag[0]=true;
           }

           @Override
           public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {


           }

           @Override
           public void afterTextChanged(Editable editable) {

           }
       });

       goodsGv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
           @Override
           public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {


           }
       });
   }
   public static void put(){

   }

    //viewpager adapter
    class MyVpAdapter extends FragmentPagerAdapter {


        public MyVpAdapter(FragmentManager fm) {
            super(fm);
        }

        @Override
        public Fragment getItem(int position) {
            return null;
        }

        @Override
        public int getCount() {
            return 0;
        }
    }
}
